﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml;

namespace themovieproduction.siniflar
{
    public class view :System.Web.UI.Page
    {// bu sinifdaki tum metodlar  ekrana basialacak menuleri ihtiva eder

    
        private static string[] kelimeler;
        private static string[] diller;
        private static string[] cult = {"tr-TR","en-EN","en-US","ru-RU"};
        private string dashboard { get; set; }
        private string createproject { get; set; }
        private string joinproject { get; set; }
        private string myproject { get; set; }
        private static string culture { get; set; }
                    
        // diger menubasliklari buraya set edilecek boylece  dil dosyalarina gore iceriklerin degismesi saglanacak

        
        public void banner_A1()
        { 
        
        } //  sayfa yapisina gore birden fazla banner renderir olabilir; 

        public static void client_lang_menubas()
        {
            string menustr = "";
          for (int i = 0; i < 4; i++)
			{
             menustr += "<li style='display:inline-block; margin-left:10px;'><a href='dashboard.aspx?lang="+cult[i]+"'>" + diller[i] + "</a></li>"; 
			}
                    
            HttpContext.Current.Response.Write(menustr);
       }

        public static void client_main_menubas()
        {
            string menustr = "";
            string[] urllinks={"controlpanel","projeolustur","joinaproject","myproject","teammanage","sistemreport","ayarlar"}; 

            for (int i = 0; i < 7; i++)
            {
              if (kelimeler[i] != null   )
                {
                   
                    string page = "AjaxQuery/"+urllinks[i]+".aspx?lang=" + culture;

                    // lang parametresine gore hangi dilde basilacagini belirleyir Dil dosyalarindan cekecek     
                    string test = "icerikgetir('" + page + "')";
                    menustr += "<li id='menutab' onclick=" + test + "><a href='#'>" + kelimeler[i] + "</a></li>";
                }
            }
           
            HttpContext.Current.Response.Write(menustr); 
        }

        // control panelini render eden sayfa
        public static void render_controlpanel()
        {
            string menustr = "";



            menustr = "<div><div class='kontroldiv'><label> Standart Projeler</label><div></div></div><div class='kontroldiv'><label>Takim Projeleri</label><div></div></div><div class='kontroldiv'><label> Projelerinizdeki Takimuyeleri Projeler</label><div></div></div><div class='kontroldiv'><label> Dahil  Oldugunuz Projeler</label><div></div></div><div class='kontroldiv'> <label> Son Hareketler</label><div></div></div></div>";

            HttpContext.Current.Response.Write(menustr);
            
        }

        // proje olu;turulmak istendiginde talep edilen sayfa
        public static void render_projeolustur()
        {
            // control panel sayfasi ajax ile cagiriliyor
            string page = "AjaxQuery/singleproject.aspx?lang=" + culture;
            string test = "icerikgetir2('" + page + "')";
            string page2 = "AjaxQuery/teamproject.aspx?lang=" + culture;
            string test2 = "icerikgetir2('" + page2 + "')";
            string menustr = "<div id='proje_yarat'><div id='projecttype'><a href='#' onclick=" + test + "><img src='icon/stproc.ico' width=50 height=50  onclick=" + test + " />" + kelimeler[7] + "</a></div><div id='projecttype'><a href='#' onclick=" + test2 + "><img src='icon/teamproc.ico' width=50 height=50 onclick=" + test2 + " />" + kelimeler[8] + "</a></div></div><br><div id='ajaxcontent2'></div>";


            HttpContext.Current.Response.Write(menustr);
            
        }

        // projeye katilmak istendi[inde talep edilen sayfa
        public static void render_projeyekatil()
        {
            // control panel sayfasi ajax ile cagiriliyor
            string page = "AjaxQuery/singleproject.aspx?lang=" + culture;
            string test = "icerikgetir2('" + page + "')";
            string page2 = "AjaxQuery/teamproject.aspx?lang=" + culture;
            string test2 = "icerikgetir2('" + page2 + "')";
            string menustr = "<div id='proje_yarat'><div id='projecttype'><a href='#' onclick=" + test + "><img src='icon/stproc.ico' width=50 height=50  onclick=" + test + " />" + kelimeler[7] + "</a></div><div id='projecttype'><a href='#' onclick=" + test2 + "><img src='icon/teamproc.ico' width=50 height=50 onclick=" + test2 + " />" + kelimeler[8] + "</a></div></div><br><div id='ajaxcontent2'></div>";

            HttpContext.Current.Response.Write(menustr);
        }

        // projelerim talep edildiginde render olacak olan sayfa
        public static void render_projelerim()
        {

            string menustr = "";
            // control panel sayfasi ajax ile cagiriliyor
            string page = "AjaxQuery/projectdetails.aspx?lang=" + culture;
            string test = "icerikgetir('" + page + "')";
        

            menustr = "<div><div class='kontroldiv'><label>falan filan projesi  Standart Proje Owner</label><div><a href='#' onclick=" + test + " >Detaylar</a></div></div>";



           
            HttpContext.Current.Response.Write(menustr);

        }

        // takim y,netimi talep edildi[inde talep edilen sayfa
        public static void render_takimyonetimi()
        {
            // control panel sayfasi ajax ile cagiriliyor
            string page = "AjaxQuery/singleproject.aspx?lang=" + culture;
            string test = "icerikgetir2('" + page + "')";
            string page2 = "AjaxQuery/teamproject.aspx?lang=" + culture;
            string test2 = "icerikgetir2('" + page2 + "')";
            string menustr = "<div id='proje_yarat'><div id='projecttype'><a href='#' onclick=" + test + "><img src='icon/stproc.ico' width=50 height=50  onclick=" + test + " />" + kelimeler[7] + "</a></div><div id='projecttype'><a href='#' onclick=" + test2 + "><img src='icon/teamproc.ico' width=50 height=50 onclick=" + test2 + " />" + kelimeler[8] + "</a></div></div><br><div id='ajaxcontent2'></div>";

            HttpContext.Current.Response.Write(menustr);
        }

        // sistem raporlari talep edildiginde istenen sayfa
        public static void render_sistemraporlari()
        {
            // control panel sayfasi ajax ile cagiriliyor
            string page = "AjaxQuery/singleproject.aspx?lang=" + culture;
            string test = "icerikgetir2('" + page + "')";
            string page2 = "AjaxQuery/teamproject.aspx?lang=" + culture;
            string test2 = "icerikgetir2('" + page2 + "')";
            string menustr = "<div id='proje_yarat'><div id='projecttype'><a href='#' onclick=" + test + "><img src='icon/stproc.ico' width=50 height=50  onclick=" + test + " />" + kelimeler[7] + "</a></div><div id='projecttype'><a href='#' onclick=" + test2 + "><img src='icon/teamproc.ico' width=50 height=50 onclick=" + test2 + " />" + kelimeler[8] + "</a></div></div><br><div id='ajaxcontent2'></div>";

            HttpContext.Current.Response.Write(menustr);
        }

        // ayarlar butonuna tiklandigi zaman cali;acak olan  render sayfasi
        public static void render_ayarlar()
        {
            // control panel sayfasi ajax ile cagiriliyor
            string page = "AjaxQuery/singleproject.aspx?lang=" + culture;
            string test = "icerikgetir2('" + page + "')";
            string page2 = "AjaxQuery/teamproject.aspx?lang=" + culture;
            string test2 = "icerikgetir2('" + page2 + "')";
            string menustr = "<div id='proje_yarat'><div id='projecttype'><a href='#' onclick=" + test + "><img src='icon/stproc.ico' width=50 height=50  onclick=" + test + " />" + kelimeler[7] + "</a></div><div id='projecttype'><a href='#' onclick=" + test2 + "><img src='icon/teamproc.ico' width=50 height=50 onclick=" + test2 + " />" + kelimeler[8] + "</a></div></div><br><div id='ajaxcontent2'></div>";

            HttpContext.Current.Response.Write(menustr);
        }

        // ajax contentlerden single project alani
        public static void render_singleproject()
        { 
           
        }

        // ajax contentlerden teamprojecti render edecek olansayfa
        public static void render_teamproject()
        {

        }

         // ajax contentlerden teamprojecti render edecek olansayfa
        public static void render_projedetaylari()
        {
            string menustr ="";
            string[] dizi = {"senaryo","yonetim","setekibi","idari","produksyon"};
            

            menustr = "<h2>Projenin Yonetim paneli</h2><label><a href='#'>Projenin Künyesi</a></label><ul>";
                for (int i = 0; i < dizi.Length; i++)
			{
                string page = "AjaxQuery/" + dizi[i] + ".aspx?lang=" + culture;
                string test = "icerikgetir2('" + page + "')";
                menustr += "<li class='pm'   onclick=" + test + "><a href='#'>" + dizi[i] + "</a></li>";
			}

                menustr += "</ul>";

                HttpContext.Current.Response.Write(menustr);
        }


        public void footerbas() // sayfa yapisina gore birdenfazla menu basimi olabilir
        { 
        
        }

        public static void xmlyukle(string cult)
        {
            kelimeler = new string[10];
            culture = cult;
            XmlTextReader xrd = new XmlTextReader("d:\\contentlang\\" + cult + ".xml");
            int i = 0;
            while (xrd.Read())
            {
                if (xrd.NodeType == XmlNodeType.Text )
                {
                    kelimeler[i] = xrd.Value.ToString();
                    i++;
                }
                
            }
            xrd.Close();
            diller = new string[10];

            XmlTextReader  lang = new XmlTextReader("d:\\lang\\langs.xml");
            int b = 0;
            while (lang.Read())
            {
                if (lang.NodeType == XmlNodeType.Text)
                {
                    diller[b] = lang.Value.ToString();
                    b++;
                }

            }
            lang.Close();
        }


    

    }
}